<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true"
    CodeFile="VoucherPrinting.aspx.cs" Inherits="Admin_VoucherPrinting" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Panel ID="pn_Refresh" runat="server" DefaultButton="btn_Refresh">
        <table style="width: 100%;">
            <tr>
                <td style="width: 100px">
                    Period:
                </td>
                <td style="width: 200px">
                    <asp:TextBox ID="tb_Period" runat="server" CssClass="text-input medium-input"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tb_Period"
                        Display="Dynamic" ErrorMessage="* Required" ValidationGroup="Period"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:Button ID="btn_Refresh" runat="server" Text="Refresh" CssClass="button" OnClick="btn_Refresh_Click"
                        ValidationGroup="Period" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pn_Print" runat="server" DefaultButton="btn_Print">
        <table style="width: 100%;">
            <tr>
                <td style="width: 100px">
                    Batch (No):
                </td>
                <td style="width: 200px">
                    <asp:DropDownList ID="ddl_BatchNo" CssClass="text-input" Width="150px" runat="server"
                        AutoPostBack="True" OnSelectedIndexChanged="ddl_BatchNo_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 130px">
                    <span>Load Invoice Details ?</span>
                </td>
                <td>
                    <asp:CheckBox ID="cb_InvoiceDetails" runat="server" CssClass="ui-icon-check" Width="26px"
                        Checked="True" />
                </td>
            </tr>
            <tr>
                <td>
                    Alloc Reference:
                </td>
                <td>
                    <asp:DropDownList ID="ddl_AllocRef" runat="server" Width="150px" CssClass="text-input disable-chosen"
                        AutoPostBack="True" OnSelectedIndexChanged="ddl_AllocRef_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddl_AllocRef"
                        Display="Dynamic" ErrorMessage="* Required" ValidationGroup="Print"></asp:RequiredFieldValidator>
                </td>
                <td>
                    Description:
                </td>
                <td>
                    <asp:TextBox ID="tb_Description" runat="server" CssClass="text-input medium-input"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tb_Description"
                        Display="Dynamic" ErrorMessage="* Required" ValidationGroup="Print"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr id="tr_CreditCard" runat="server" style="display: none">
                <td>
                    Credit Card:
                </td>
                <td>
                    <asp:DropDownList ID="ddl_CreditCard" runat="server" Width="150px" 
                        CssClass="text-input disable-chosen" DataSourceID="CreditCardDataSource1" 
                        DataTextField="CardHolderName" DataValueField="CreditCardId">
                    </asp:DropDownList>
                </td>
                <td colspan="2">
                    <data:CreditCardDataSource ID="CreditCardDataSource1" runat="server" SelectMethod="GetPaged">
                        <DeepLoadProperties Method="IncludeChildren" Recursive="False" />
                        <Parameters>
                            <data:CustomParameter Name="WhereClause" DefaultValue="IsDisabled=0" />
                        </Parameters>
                    </data:CreditCardDataSource>
                </td>
            </tr>
            <tr>
                <td>
                    Prefix:
                </td>
                <td>
                    <asp:DropDownList ID="ddl_Prefix" runat="server" Width="150px" CssClass="text-input disable-chosen">
                        <Items>
                            <asp:ListItem Text="04A" />
                            <asp:ListItem Text="04B" />
                            <asp:ListItem Text="04C" />
                            <asp:ListItem Text="04D" />
                        </Items>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfv_Prefix" runat="server" ControlToValidate="ddl_Prefix"
                        Display="Dynamic" ErrorMessage="* Required" ValidationGroup="Print"></asp:RequiredFieldValidator>
                </td>
                <td colspan="2">
                    <asp:Button ID="btn_Print" runat="server" Text="Print" CssClass="button" ValidationGroup="Print"
                        OnClick="btn_Print_Click" OnClientClick="aspnetForm.target ='_blank';" />&nbsp;
                    <asp:Button ID="btn_Save" runat="server" Text="Save" CssClass="button" ValidationGroup="Print"
                        OnClick="btn_Save_Click" />&nbsp;
                    <asp:Button ID="btn_RefreshAllocRef" runat="server" Text="Refresh" CssClass="button"
                        ValidationGroup="Print" OnClick="btn_RefreshAllocRef_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <table style="width: 100%;">
        <tr>
            <td>
                <h3>
                    Batch List</h3>
                <data:EntityGridView ID="grv_BatchList" runat="server" AutoGenerateColumns="False"
                    AllowPaging="True" DataSourceID="" AllowExportToExcel="True" AllowSorting="True"
                    ExportToExcelText="Excel" PageSelectorPageSizeInterval="10" OnPageIndexChanging="grv_BatchList_PageIndexChanging"
                    OnExcelBeforeFormat="grv_BatchList_ExcelBeforeFormat">
                    <Columns>
                        <asp:BoundField DataField="AccntCode" HeaderText="AccntCode" SortExpression="AccntCode" />
                        <asp:BoundField DataField="TransDate" HeaderText="TransDate" SortExpression="TransDate" />
                        <asp:BoundField DataField="Period" HeaderText="Period" SortExpression="Period" />
                        <asp:BoundField DataField="JrnalNo" HeaderText="JrnalNo" SortExpression="JrnalNo" />
                        <asp:BoundField DataField="Treference" HeaderText="Treference" SortExpression="Treference" />
                        <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                        <asp:BoundField DataField="DC" HeaderText="DC" SortExpression="DC" />
                        <asp:BoundField DataField="Descriptn" HeaderText="Descriptn" SortExpression="Descriptn" />
                        <asp:BoundField DataField="ConvRate" HeaderText="ConvRate" SortExpression="ConvRate" />
                        <asp:BoundField DataField="OtherAmt" HeaderText="OtherAmt" SortExpression="OtherAmt" />
                        <asp:BoundField DataField="AnalT1" HeaderText="AnalT1" SortExpression="AnalT1" />
                        <asp:BoundField DataField="AnalT2" HeaderText="AnalT2" SortExpression="AnalT2" />
                        <asp:BoundField DataField="AnalT3" HeaderText="AnalT3" SortExpression="AnalT3" />
                        <asp:BoundField DataField="AnalT4" HeaderText="AnalT4" SortExpression="AnalT4" />
                        <asp:BoundField DataField="AnalT5" HeaderText="AnalT5" SortExpression="AnalT5" />
                        <asp:BoundField DataField="AllocRef" HeaderText="AllocRef" SortExpression="AllocRef" />
                        <asp:BoundField DataField="SunRefer" HeaderText="SunRefer" SortExpression="SunRefer" />
                        <asp:BoundField DataField="JrnalSrce" HeaderText="JrnalSrce" SortExpression="JrnalSrce" />
                    </Columns>
                </data:EntityGridView>
            </td>
        </tr>
        <tr>
            <td>
                <h3>
                    Invoice Details</h3>
                <data:EntityGridView ID="grv_InvoiceDetails" runat="server" AutoGenerateColumns="False"
                    AllowPaging="True" DataSourceID="" AllowExportToExcel="True" AllowSorting="True"
                    ExportToExcelText="Excel" PageSelectorPageSizeInterval="10" OnPageIndexChanging="grv_InvoiceDetails_PageIndexChanging"
                    OnExcelBeforeFormat="grv_InvoiceDetails_ExcelBeforeFormat">
                    <Columns>
                        <asp:BoundField DataField="AccntCode" HeaderText="AccntCode" SortExpression="AccntCode" />
                        <asp:BoundField DataField="TransDate" HeaderText="TransDate" SortExpression="TransDate" />
                        <asp:BoundField DataField="Period" HeaderText="Period" SortExpression="Period" />
                        <asp:BoundField DataField="JrnalNo" HeaderText="JrnalNo" SortExpression="JrnalNo" />
                        <asp:BoundField DataField="Treference" HeaderText="Treference" SortExpression="Treference" />
                        <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                        <asp:BoundField DataField="DC" HeaderText="DC" SortExpression="DC" />
                        <asp:BoundField DataField="Descriptn" HeaderText="Descriptn" SortExpression="Descriptn" />
                        <asp:BoundField DataField="ConvRate" HeaderText="ConvRate" SortExpression="ConvRate" />
                        <asp:BoundField DataField="OtherAmt" HeaderText="OtherAmt" SortExpression="OtherAmt" />
                        <asp:BoundField DataField="AnalT1" HeaderText="AnalT1" SortExpression="AnalT1" />
                        <asp:BoundField DataField="AnalT2" HeaderText="AnalT2" SortExpression="AnalT2" />
                        <asp:BoundField DataField="AnalT3" HeaderText="AnalT3" SortExpression="AnalT3" />
                        <asp:BoundField DataField="AnalT4" HeaderText="AnalT4" SortExpression="AnalT4" />
                        <asp:BoundField DataField="AnalT5" HeaderText="AnalT5" SortExpression="AnalT5" />
                        <asp:BoundField DataField="AllocRef" HeaderText="AllocRef" SortExpression="AllocRef" />
                        <asp:BoundField DataField="SunRefer" HeaderText="SunRefer" SortExpression="SunRefer" />
                        <asp:BoundField DataField="JrnalSrce" HeaderText="JrnalSrce" SortExpression="JrnalSrce" />
                    </Columns>
                </data:EntityGridView>
            </td>
        </tr>
    </table>
    <%--<data:SunInvoiceDataSource ID="SunInvoiceDataSource1" runat="server" SelectMethod="GetPaged"
        EnablePaging="True" EnableSorting="True">
        <Parameters>
            <data:CustomParameter Name="WhereClause" ConvertEmptyStringToNull="True" />
            <data:CustomParameter Name="OrderByClause" Value="ReturnedDate DESC" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="grv_BatchList" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="grv_BatchList" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:SunInvoiceDataSource>
    <data:SunInvoiceDataSource ID="SunInvoiceDataSource2" runat="server" SelectMethod="GetPaged"
        EnablePaging="True" EnableSorting="True">
        <Parameters>
            <data:CustomParameter Name="WhereClause" ConvertEmptyStringToNull="True" />
            <data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="grv_InvoiceDetails" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="grv_InvoiceDetails" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:SunInvoiceDataSource>--%>
</asp:Content>
